package com.jk.smartelderlycare.controller;

import com.jk.smartelderlycare.dto.SysPharm;
import com.jk.smartelderlycare.interfaces.SysPharmServiceApi;
import com.jk.smartelderlycare.pojo.PagedResponse;
import com.jk.smartelderlycare.service.SysPharmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hhk
 * @version 1.0
 * @ClassName SYsPharmController
 * @program: smart-elderly-care
 * @description: TODO
 * @date 2024/11/7 19:36
 */
@Slf4j
@RestController
public class SYsPharmController implements SysPharmServiceApi {
    @Autowired
    private SysPharmService sysPharmService;
    /** 
     * @description: 药品后端分页查询
     * @param: [sysPharm, pageNum, pageSize]
     * @return: com.jk.smartelderlycare.pojo.PagedResponse<com.jk.smartelderlycare.dto.SysPharm>
     * @author hhk
     * @date: 2024/11/7 19:38
     */ 
    @Override
    public PagedResponse<SysPharm> findSysPharmPaginationList(SysPharm sysPharm, Integer pageNum, Integer pageSize) {
        return sysPharmService.findSysPharmPaginationList(sysPharm, pageNum, pageSize);
    }
    /** 
     * @description: 新增药品列表
     * @param: [sysPharm]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 19:38
     */ 
    @Override
    public void addSysPharm(SysPharm sysPharm) {
        sysPharmService.addSysPharm(sysPharm);
    }
    
    /** 
     * @description: 根据id删除一条数据
     * @param: [pharmId]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 19:39
     */ 
    @Override
    public void deleteSysPharmByPharmId(Long pharmId) {
        sysPharmService.deleteSysPharmByPharmId(pharmId);
    }
    /** 
     * @description: 根据id回显一条数据
     * @param: [pharmId]
     * @return: com.jk.smartelderlycare.dto.SysPharm
     * @author hhk
     * @date: 2024/11/7 19:39
     */ 
    @Override
    public SysPharm findSysPharmByPharmId(Long pharmId) {
        return sysPharmService.findSysPharmByPharmId(pharmId);
    }
    /** 
     * @description: 修改药品列表
     * @param: [sysPharm]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 19:39
     */ 
    @Override
    public void updateSysPharm(SysPharm sysPharm) {
        sysPharmService.updateSysPharm(sysPharm);
    }
    /** 
     * @description: 状态修改
     * @param: [sysPharm]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 19:40
     */ 
    @Override
    public void updateStatusById(SysPharm sysPharm) {
        sysPharmService.updateStatusById(sysPharm);
    }
}
